import React, { useEffect, Fragment } from 'react'
import { Routes, Route, useNavigate } from 'react-router-dom'
import { Tabs, Badge } from 'antd-mobile'
import Homes from './home/Homes'
import Strategy from './home/Strategy'
import Race from './home/Race'

export default function Home(props) {
    let push = useNavigate()
    return (
        <Fragment>
            <h2>
                我是标题
            </h2>
            <Tabs onChange={(path) => {
                push(path)
            }}>
                <Tabs.Tab title='首页' key='/home'>     
                </Tabs.Tab>
                <Tabs.Tab title='攻略中心' key='/strategy'>
                </Tabs.Tab>
                <Tabs.Tab title='赛事中心' key='/race'>
                </Tabs.Tab>
            </Tabs>

            <Routes>
                <Route path="/home" element={<Homes />} />
                <Route path="/strategy" element={<Strategy />} />
                <Route path="/race" element={<Race />} />
            </Routes>
        </Fragment>
    )
}
